package cn.iocoder.yudao.module.diy.controller.app.diy;

import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
import cn.iocoder.yudao.module.diy.controller.app.diy.param.DiyInfoParam;
import cn.iocoder.yudao.module.diy.controller.app.diy.param.DiyShareParam;
import cn.iocoder.yudao.module.diy.controller.app.diy.param.DiyTabbarListParam;
import cn.iocoder.yudao.module.diy.controller.app.diy.param.DiyTabbarParam;
import cn.iocoder.yudao.module.diy.service.diy.IDiyAppService;
import io.swagger.v3.oas.annotations.media.Schema;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.annotation.security.PermitAll;

import static cn.iocoder.yudao.framework.common.pojo.CommonResult.successApp;


/**
 * 自定义页面管理
 */
@Schema(description = "用户 App - ns装修页面 Response VO")
@RestController
@RequestMapping("/diy")
public class AppDiyController {

    @Resource
    private IDiyAppService diyService;

    /**
     * 自定义页面信息
     *
     * @param param
     * @return
     */
    @GetMapping("/diy")
    @PermitAll
    public CommonResult<?> info(DiyInfoParam param) {
        return successApp(diyService.info(param));
    }

    @GetMapping("/tabbar")
    @PermitAll
    public CommonResult<?> tabbar(DiyTabbarParam param) {
        return successApp(diyService.tabbar(param));
    }

    @GetMapping("/tabbar/list")
    @PermitAll
    public CommonResult<?> tabbarList(DiyTabbarListParam param) {
        return successApp(diyService.tabbarList(param));
    }

    @GetMapping("/share")
    @PermitAll
    public CommonResult<?> share(DiyShareParam param) {
        return successApp(diyService.share(param));
    }
}
